<template>
  <div>
    <h3>购物车</h3>
    <h3>路由restful参数为：{{ routeParam }}</h3>
    <h3>路由query参数为：{{ routeQuery }}</h3>

  </div>
</template>

<script>
export default {
  data() {
    return {
      routeParam: "",
      routeQuery: "",

    };
  },
  props: [
    'name','age'
  ],

  created() {
    let name = this.$route.params.name;
    let age = this.$route.params.age;
    let person = {name: name, age: age};
    let perStr = JSON.stringify(person);
    console.log(perStr);
    this.routeParam = perStr;

    let name2 = this.$route.query.name;
    let age2 = this.$route.query.age;
    let per2 = {name: name2, age: age2};
    this.routeQuery = JSON.stringify(per2);
  }
}
</script>
<style scoped>

</style>
